<?php

/**
 * 网址：http://www.tooopen.com
 * 随机性感美女图片
 */

error_reporting(0);

function image() {

	// 随机页数
	$i = rand(1, 3);
	$url = "http://www.tooopen.com/img/88_878_1_{$i}.aspx";

	$content = file_get_contents($url);
	$preg = "/((http|https):\/\/)+(\w+\.)+(\w+)[\w\/\.\-]*(jpg|gif|png)/";
	preg_match_all ($preg, $content, $arr);
	$img_arr = $arr[0];
	$count = count($img_arr) - 5;
	$rand = rand(0, $count);
	return $img_arr[$rand];
}

$img = image();
//header("Location:{$img}");
$suff = ltrim(strrchr($img, '.'), '.');
header("content-type:image/{$suff}");
echo file_get_contents($img);
